<!--#
layout("/layouts/platform.html"){
#-->
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/dec/component" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="editForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/dec/component/editDo" method="post">
                <input name="id" type="hidden" value="${obj.id}">
                <div class="row mb10 mt10">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="compId" class="col-sm-2 control-label">${msg['dec.component.column.compId']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="compId" class="form-control" name="compId" data-parsley-required="true"
                                       placeholder="${msg['dec.component.column.compId']}" value="${obj.compId}" >
                            </div>
                        </div>
                       <!-- <div class="form-group">
                            <label for="versionType" class="col-sm-2 control-label">${msg['dec.component.column.versionType']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="versionType" class="form-control" name="versionType" data-parsley-required="true"
                                       placeholder="${msg['dec.component.column.versionType']}" value="${obj.versionType}" >
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label for="compCategoryUuid" class="col-sm-2 control-label">${msg['dec.component.column.compCategoryUuid']}</label>
                            <div class="col-sm-8">
                                <select id="compCategoryUuid" class="form-control" name="compCategoryUuid">
                                    <!--# for(o in list){
        #-->
                                    <option value="${o.id}" <!--#if(obj.compCategoryUuid==o.id){#-->selected<!--#}#-->>${o.categoryName}</option>
                                    <!--#
                    }#-->
                                </select>
                            </div>
                        </div>
                        <!--<div class="form-group">
                            <label for="compType" class="col-sm-2 control-label">${msg['dec.component.column.compType']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="compType" class="form-control" name="compType" data-parsley-required="true"
                                       placeholder="${msg['dec.component.column.compType']}" value="${obj.compType}" >
                            </div>
                        </div>-->
                       <!-- <div class="form-group">
                            <label for="useType" class="col-sm-2 control-label">${msg['dec.component.column.useType']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="useType" class="form-control" name="useType" data-parsley-required="true"
                                       placeholder="${msg['dec.component.column.useType']}" value="${obj.useType}" >
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label for="compName" class="col-sm-2 control-label">${msg['dec.component.column.compName']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="compName" class="form-control" name="compName" data-parsley-required="true"
                                       placeholder="${msg['dec.component.column.compName']}" value="${obj.compName}" >
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="versionType" class="col-sm-2 control-label">${msg['dec.component.column.versionType']}</label>
                            <div class="col-sm-8">
                                <select id="versionType" class="form-control" name="versionType" data-parsley-required="true">
                                    <option value="">-请选择-</option>
                                    <option value="1" <!--#if(obj.versionType==1){#-->selected<!--#}#-->>电脑端</option>
                                    <option value="2" <!--#if(obj.versionType==2){#-->selected<!--#}#-->>手机端</option>
                                    <option value="3" <!--#if(obj.versionType==3){#-->selected<!--#}#-->>微信端</option>
                                    <option value="4" <!--#if(obj.versionType==4){#-->selected<!--#}#-->>电视端</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="competence" class="col-sm-2 control-label">${msg['dec.component.column.competence']}</label>
                            <div class="col-sm-8">
                                <select id="competence" class="form-control" name="competence" data-parsley-required="true">
                                    <option value="" <!--#if(obj.competence==""){#-->selected<!--#}#-->>-请选择-</option>
                                    <option value="1" <!--#if(obj.competence=="1"){#-->selected<!--#}#-->>公共类</option>
                                    <option value="2" <!--#if(obj.competence=="2"){#-->selected<!--#}#-->>平台类</option>
                                    <option value="3" <!--#if(obj.competence=="3"){#-->selected<!--#}#-->>商户类</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="compType" class="col-sm-2 control-label">${msg['dec.component.column.compType']}</label>
                            <div class="col-sm-8">
                                <select id="compType" class="form-control" name="compType" data-parsley-required="true">
                                    <option value="">-请选择-</option>
                                    <option value="1" <!--#if(obj.compType==1){#-->selected<!--#}#-->>系统组件</option>
                                    <option value="2" <!--#if(obj.compType==2){#-->selected<!--#}#-->>自定义组件</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="classFullName" class="col-sm-2 control-label">${msg['dec.component.column.classFullName']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="classFullName" class="form-control" name="classFullName" data-parsley-required="true"
                                       placeholder="${msg['dec.component.column.classFullName']}" value="${obj.classFullName}" >
                                <span class="star-red">请填写有效的类路径，如：com.aebiz.app.dec.commons.comps.bottom.vo.BottomCompModel</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="description" class="col-sm-2 control-label">${msg['dec.component.column.description']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="description" class="form-control" name="description" data-parsley-required="true"
                                       placeholder="${msg['dec.component.column.description']}" value="${obj.description}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="disabled" class="col-sm-2 control-label">${msg['dec.component.column.disabled']}</label>
                            <div class="col-sm-8 switcha">
                                <input type="checkbox" id="disabled"  name="disabled" class="js-switch-blue"  <!--#if(obj.disabled){#-->checked<!--#}#--> >
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3"></div>
                <div class="col-lg-6">
                    <div class="form-group text-center">
                        <label></label>

                        <div>
                            <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="${msg['globals.button.submit.tip']}">${msg['globals.button.submit']}</button>
                        </div>
                    </div>
                </div>
            </form>
        </section>

    </div>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        myForm.init();
        $('#editForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    setTimeout(function () {
                        $("#goBack").trigger("click");
                    }, 1000);
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>
<!--#}#-->